using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace MVExplorer
{
	public delegate void NumClickEventHandler(object sender, string number);

	public partial class NumberPad : System.Windows.Controls.UserControl
	{
		public event NumClickEventHandler NumClicked;
		public event EventHandler BackspaceClicked;
		public event EventHandler OkClicked;

		public NumberPad()
		{
			InitializeComponent();
			
		}

		void number_Click(object sender, RoutedEventArgs e)
		{
			Button btn = sender as Button;
			Debug.Assert(btn != null);
			if (btn == null || btn.Content == null)
				return;
			if (NumClicked != null)
				NumClicked(this, btn.Content.ToString());
		}

		void backspace_Click(object sender, RoutedEventArgs e)
		{
			if (BackspaceClicked != null)
				BackspaceClicked(this, new EventArgs());
		}

		void ok_Click(object sender, RoutedEventArgs e)
		{
			if (OkClicked != null)
				OkClicked(this, new EventArgs());
		}
	}
}